import React, { Suspense } from 'react'
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import { ROUTER_LIST } from './routes'
import { PrivateRouter } from '../components'
// 1. 面试题： BrowserRouter, HashRouter 有啥区别？ 

const Router: React.FC = () => {
  return <Suspense fallback="加载中....">
    <Routes>
      {
        ROUTER_LIST.map((v, i) => {
          return <Route key={i} path={v.path} element={<PrivateRouter route={v}  el={v.element}></PrivateRouter>}></Route>
        })
      }
    </Routes>
  </Suspense>

}

// 高阶组件


export default Router